package com.chongzi.cloud;

public class MaoPao {
    public static void main(String[] args) {
        int[] nums =new int[]{432 ,5,3,6,2};
        bubbleSort(nums);
    }
    public static void bubbleSort(int[] nums){
        for (int i=0;i<nums.length;i++){
            for (int j=0;j<nums.length-1-i;j++){//防止越界
                if (nums[j]>nums[j+1]){
                     int temp=nums[j];
                     nums[j]=nums[j+1];
                     nums[j+1]=temp;
                }
            }

        }
    }
}
